import { Controller, Get } from '@nestjs/common';
import { UserAnalyticsService } from './user-analytics.service';
import { createResponse } from '../common/response.interface';
import type { IResponse } from '../common/response.interface';

@Controller('user-analytics')
export class UserAnalyticsController {
  constructor(private readonly userAnalyticsService: UserAnalyticsService) {}

  @Get('active-users')
  async getActiveUsersLast24h(): Promise<IResponse<any>> {
    const data = await this.userAnalyticsService.getActiveUsersLast24h();
    return createResponse(data);
  }
}